# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-pysubs2
pkgver=1.7.3
pkgrel=0
pkgdesc="Python library for editing subtitle files"
url="https://github.com/tkarabela/pysubs2"
arch="noarch"
license="MIT"
makedepends="py3-setuptools py3-gpep517"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/tkarabela/pysubs2/archive/$pkgver/pysubs2-$pkgver.tar.gz"
builddir="$srcdir/pysubs2-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
f6dd3ca7c64e8843e4abb86231b57465cbeabbb91b9c99d108552a4aca079d3536e448fbc2fe24bd663930f75df25070227bd95a7e45525906ea7f76497275c3  pysubs2-1.7.3.tar.gz
"
